package code.part06_Thread;

/**
 * @author: ZJT
 * @Time: 2021/7/23
 * @Description: 从共享空间中取走产品
 */
public class Consumer implements Runnable {

    private Goods goods;

    public Consumer(Goods goods) {
        this.goods = goods;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            goods.get();
        }
    }
}
